package net.alan.modules.repository;

import net.alan.modules.bean.Note;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 * Author 李岩飞
 * Email eliyanfei@126.com
 * 2017/11/22
 */
public interface NoteRepository extends JpaRepository<Note, Integer> {

    Page<Note> findByUserId(Integer userId, Pageable pageable);

    Page<Note> findByUserIdAndCatalogId(Integer userId, Integer catalogId, Pageable pageable);

    Integer countByCatalogId(Integer catalogId);

    Note getByShareId(String shareId);
}
